package com.mr.security.web.commons.utils;


import com.mr.security.web.commons.vo.ResultVO;

/**
 * @ClassName: ResultVOUtil
 * @User MRui
 * @Description: TODO描述：结果返回工具类
 * @date 2018.09.18 23:27
 */
public class ResultVOUtil {

    /**
    * @user (作者)MRui
    * @Description: TODO描述:成功时调用
    * @date 2018.09.18 23:30
    */
    public static ResultVO success(Object object){
        ResultVO resultVO = new ResultVO();
        resultVO.setCode(0);
        resultVO.setMsg("成功");
        resultVO.setData(object);
        return resultVO;
    }
    /**
    * @user (作者)MRui
    * @Description: TODO描述:传入空，什么数据都不传
    * @date 2018.09.18 23:33
    */
    public static ResultVO success(){
        return success(null);
    }
    /**
    * @user (作者)MRui
    * @Description: TODO描述:失败
    * @date 2018.09.18 23:34
    */
    public static ResultVO error(int code,String msg){
        ResultVO resultVO = new ResultVO();
        resultVO.setMsg(msg);
        resultVO.setCode(code);
        return resultVO;
    }
}
